package com.example.workflow;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

@Component("monitorExecution")
public class MonitorExecution implements JavaDelegate{

	@Override
    public void execute(DelegateExecution delegateExecution) throws Exception {
        String processInstanceId = delegateExecution.getProcessInstanceId();
        
        delegateExecution.getVariable("approved");
        System.out.println("服务任务（ServiceTask）的监听器---------------自动执行:：： " + processInstanceId);
    }

}
